//---------------------------------------------------------------------------

#include <vcl.h>
#include <stdlib.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;



test *t;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
   : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
   Label1->Caption = IntToStr(random(1000));
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn2Click(TObject *Sender)
{
  BitBtn1->OnMouseMove = t->Move3;

}                             __closure
//---------------------------------------------------------------------------



void __fastcall TForm1::BitBtn1MouseMove2(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
   Label1->Caption = IntToStr(X*100);
}
void __fastcall TForm1::FormCreate(TObject *Sender)
{
   t = new test();

}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
   delete t;
}
//---------------------------------------------------------------------------


void __fastcall test::Move3(TObject *Sender,
      TShiftState Shift, int X, int Y)
{

    Form1->Label1->Caption = IntToStr(X*100);

}